﻿@using hc.epm.Common;
@using hc.Plat.Common.Extend;
@using hc.epm.ViewModel;
@using hc.epm.DataModel.Business;
@model CompletionAcceptanceResUploadView
@{
    ViewBag.Title = "Detail";
    Epm_Project item = ViewBag.project;

    List<CompletionAcceptanceItemView> itemList = ViewBag.CompletionAcceptanceItemList;
    var type = 0;
    var listQuestion = itemList.Where(p => p.Type == "Epm_Question" && !string.IsNullOrEmpty(p.Id)).ToList();
    if (listQuestion.Count > 0)
    {
        type = 1;
    }
}

<link href="~/Resource/css/ProjectManagement.css" rel="stylesheet" />

<div class="contentData">
    <form class="form-horizontal" id="mainForm">

        <div class="module-div">
            <h4>项目基本信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">项目名称：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.ProjectName
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">项目主体：</td>
                        <td class="td-div">
                            <div class="form-group">
                                @item.ProjectSubjectName
                            </div>
                        </td>
                        <td class="table_title">项目类型：</td>
                        <td class="td-div">
                            <div class="form-group">
                                @item.SubjectName
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">开始时间：</td>
                        <td class="td-div">
                            <div class="form-group">
                                @item.PlanWorkStartTime
                            </div>
                        </td>
                        <td class="table_title">结束时间：</td>
                        <td class="td-div">
                            @item.PlanWorkEndTime
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">项目负责人：</td>
                        <td class="td-div">
                            @item.ContactUserName
                        </td>
                        <td class="table_title">负责人电话：</td>
                        <td class="td-div">
                            @item.ContactPhone
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">项目地址：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @item.Address
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">项目简介：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @item.Description
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>更多项目信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">验收标题：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.Title
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">验收时间：</td>
                        <td class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.RecTime
                            </div>
                        </td>
                        <td class="table_title">验收类型：</td>
                        <td class="td-div">
                            @if (Model.CompletionAcceptanceResUpload.AcceptanceResult == 1)
                            {
                                <div class="form-group">
                                    <span style="margin-left:4px;">整改后通过</span>
                                </div>
                            }
                            @if (Model.CompletionAcceptanceResUpload.AcceptanceResult == 2)
                            {
                                <div class="form-group">
                                    <span style="margin-left:4px;">无</span>
                                </div>
                            }
                            else {
                                <div class="form-group">
                                    <span style="margin-left:4px;">无</span>
                                </div>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">验收内容：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.Content
                            </div>
                            <input type="hidden" name="Content" value="@Model.CompletionAcceptanceResUpload.Content" />
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">整改单位：</td>
                        <td colspan="3" class="td-div">
                            @if (Model.CompletionRectifyCompanys != null && Model.CompletionRectifyCompanys.Count() > 0)
                            {
                                foreach (var list in Model.CompletionRectifyCompanys)
                                {
                                    <span style="padding:0 4px;">
                                        @list.CompanyName
                                    </span>
                                }
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">整改内容：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.RectifContent
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">验收单位：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.RecCompanyName
                            </div>
                            <input type="hidden" name="RecCompanyId" value="@Model.CompletionAcceptanceResUpload.RecCompanyId" />
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">验收人员：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                @Model.CompletionAcceptanceResUpload.RecUserName
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">验收单：</td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">

                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>验收意见</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title" style="width:195px;">
                            <i class="color_red_x">*</i>
                            <span>
                                验收意见说明：
                            </span>
                        </td>
                        <td colspan="3" class="td-div">
                            <div class="form-group">
                                <textarea class="form-control" rows="3" name="">@Model.CompletionAcceptanceResUpload.Opinion</textarea>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        @*附件上传改造 start ---- *@
        <div class="module-div">
            <h4>附件上传</h4>
            <table class="datalist fileShow" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody class="fileShow-append">
                    @*<tr class="headtr">
                        <td style="width:300px;">附件类型</td>
                        <td class="td-div" style="width: 570px!important;">
                            @Html.Raw(Html.DropDownList("FileType", ViewBag.AnnexType as SelectList, null, new { @class = "form-control sel" }))
                            <input id="FileType" type="hidden" name="FileType" value="" />
                        </td>
                        <td class="table_title text_lf" colspan="3">
                            <div class="btn-upload" style="display:inline-block">
                                <input type="button" id="btnUploadFile1" class="btnUploadFile btn  form-control" style="position: relative; z-index: 1;width: 100px;font-size: 16px;" value="选择附件" />
                                <input type="file" id="loadFile1" name="loadFile1" style="display:none!important" onchange="uploadFile1()">
                                <span style="vertical-align:bottom; margin-left:15px; color:#B7B7B7;"></span>
                            </div>
                            <div class="color_red" style="display:inline-block;margin-left:20px;">附件类型仅支持：doc,pdf,excel,ppt,png等</div>
                        </td>
                        @*<td class="td-div"><div class="color_red text_lf">附件类型仅支持：doc,pdf,excel,ppt,png等</div></td>
                    </tr>*@
                    <tr class="headtr">
                        <th class="table_title" style="width: 219px;">序号</th>
                        <th class="td-div" style="width: 570px!important;">附件名称</th>
                        <th class="td-div">附件类型</th>
                        <th class="table_title" style="width: 219px;">操作</th>
                    </tr>
                    @if (Model.CompletionAcceptanceResUpload.TzAttachs != null && Model.CompletionAcceptanceResUpload.TzAttachs.Count() > 0)
                    {
                        foreach (var items in Model.CompletionAcceptanceResUpload.TzAttachs)
                        {
                            <tr id="${obj.GuidId}">
                                <td><span class="font-black">@items.Sort</span></td>
                                <td class="text_lf td-div"><span class="font-black">@items.Name</span></td>
                                <td><span class="font-black">@items.TypeName</span></td>
                                <td class="td-div" style="text-align:center">
                                    <a class="downloadFile" href="javascript:void(0)" data-id="@item.Id" data-name="@item.Name" data-url="@items.FilePath" style="color:#337ab7;">下载</a>
                                </td>
                            </tr>
                        }
                    }
                </tbody>
            </table>
        </div>
        @*附件上传改造 end ---- *@

        <div class="layui-form-item  btn-save" style="margin-top:60px;text-align:center;">            
            <input type="button" id="close" value="返&nbsp;&nbsp;&nbsp;回" class="layui-btn layui-btn-big " />
        </div>
    </form>
</div>


<script>
    //取消
    $("#close").click(function () {
        window.location.href = "/CompletionAcceptanceResUpload/Index";
    });

    //下载附件
    $("body").on("click", ".downloadFile", function () {
        var path = $(this).data("url");
        var fileName = $(this).data("name");
        window.location.href = "/Download/DownLoadHB?path=" + path + "&fileName=" + fileName;
    });
</script>

